import os

root_dir = os.path.abspath(os.sep)
path = "Myframe/lib"

def write_to_file_method1(params=""):
    file = root_dir + path
    # 打开文件，如果文件不存在会创建文件，如果文件存在会清空文件内容
    with open(file+'/url.txt', 'w') as file:
        file.write(params)

def read_file_method1():
    file = root_dir + path
    with open(file+'/url.txt', 'r') as file:
        content = file.read()
        print(content)
    return content
